package com.kobe.java8;

import java.util.*;

public class SetDemo {
    public static void main(String[] args) {
        Set<String> hashSet = new HashSet<>();
        Set<String> treeSet = new TreeSet<>();
        Set<String> linkHashSet = new LinkedHashSet<>();

        for (int i = 0; i < 20; i++) {
            hashSet.add(i+"");
            linkHashSet.add(i+"");
            treeSet.add(i+"");
        }

        hashSet.stream().forEach(item-> System.out.println("hashSet:"+item));
        linkHashSet.stream().forEach(item-> System.out.println("LinkHashSet:"+item));
        treeSet.stream().forEach(item-> System.out.println("TreeSet:"+item));
    }
}
